package com.baizhi.service.impl;

import com.baizhi.dao.LogDao;
import com.baizhi.entity.Banner;
import com.baizhi.entity.Log;
import com.baizhi.service.LogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class LogServiceImpl implements LogService {
    @Resource
    private LogDao logDao;
    @Override
    public void insert(Log log) {
        logDao.insert(log);
    }

    @Override
    public void deleteByIds(int[] ids) {
        logDao.deleteByIds(ids);
    }

    @Override
    public PageInfo<Log> selectAll(Integer page, Integer limit, String logType) {
        PageHelper.startPage(page,limit);
        PageInfo<Log> pageInfo = new PageInfo<>(logDao.selectAll(logType));

        return pageInfo;
    }
}
